import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.Reader;

public class FileReaderTest {
    public static void main(String[] args) {
        try (
                Reader fr=new FileReader("IO_src/fos.txt");
                ){
            // read a char
//            int c;
//            while((c=fr.read())!=-1){
//                System.out.print((char)c);
//            }
            // read chars
            char[] buffer=new char[3];
            int len;
            while((len=fr.read(buffer))!=-1){
                System.out.print(new String(buffer,0,len));
            }
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
}
